﻿using System.Collections.Generic;

namespace SharpDepend.Classes.ProfileredDatatypes.Collections.Generic
{
    public class PDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        private InstanceCounter COUNTER;
        private ProfilerStatistics PROFILER;

        public PDictionary(string DEBUGNAME, object trackedObject)
        {
            Init(DEBUGNAME, trackedObject);
        }

        public PDictionary(string DEBUGNAME, object trackedObject, int capacity)
            : base(capacity)
        {
            Init(DEBUGNAME, trackedObject);
        }

        public PDictionary(string DEBUGNAME, object trackedObject, IDictionary<TKey, TValue> dictionary)
            : base(dictionary)
        {
            Init(DEBUGNAME, trackedObject);
        }

        private void Init(string DEBUGNAME, object trackedObject)
        {
            COUNTER = new InstanceCounter(this);
            PROFILER = new ProfilerStatistics(trackedObject == null ? "NULL" : trackedObject.GetType().Name + ", " + DEBUGNAME, this);
        }
    }
}
